package com.youkeyi.ddy.cloud.common.api.application.system.menu;

import com.youkeyi.ddy.cloud.common.api.application.system.menu.dto.SystemCorpMenuListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.menu.dto.SystemMenuDetailCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.menu.dto.SystemMenuListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.menu.dto.SystemMenuTreeCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.menu.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统菜单
 *
 * @Menuor liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【SYSTEM】menu management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-SYSTEM", fallback = SystemMenuCloudServiceFallback.class)
@RequestMapping("/system/menu")
public interface SystemMenuCloudService {

    // 查询菜单列表
    @ApiOperation(value = "Query System Menu List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.menu.SystemMenuCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemMenuListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Menu List", dataType = "SystemMenuListCloudParam", dataTypeClass = SystemMenuListCloudParam.class),
    })
    @GetMapping
    public abstract SystemMenuListCloudDto list(SystemMenuListCloudParam param);

    // 查询菜单详情
    @ApiOperation(value = "Query System Menu Detail", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.menu.SystemMenuCloudService.detail")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemMenuDetailCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "menuPrimaryKey", paramType = "path", value = "Param of Query System Menu Detail", dataType = "String", dataTypeClass = String.class),
    })
    @GetMapping("/{menuPrimaryKey}")
    public abstract SystemMenuDetailCloudDto detail(@PathVariable("menuPrimaryKey") String menuPrimaryKey);

    // 查询菜单Tree
    @ApiOperation(value = "Query System Menu Tree", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.menu.SystemMenuCloudService.tree")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemMenuTreeCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Menu Tree", dataType = "SystemMenuTreeCloudParam", dataTypeClass = SystemMenuTreeCloudParam.class),
    })
    @GetMapping("/tree")
    public abstract SystemMenuTreeCloudDto tree(SystemMenuTreeCloudParam param);

    // 创建菜单
    @ApiOperation(value = "Create System Menu", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.menu.SystemMenuCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create System Menu", dataType = "SystemMenuCreateCloudParam", dataTypeClass = SystemMenuCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody SystemMenuCreateCloudParam param);


    // 编辑菜单
    @ApiOperation(value = "Update System Menu", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.menu.SystemMenuCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update System Menu", dataType = "SystemMenuUpdateCloudParam", dataTypeClass = SystemMenuUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody SystemMenuUpdateCloudParam param);


    // 删除菜单
    @ApiOperation(value = "Delete System Menu", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.menu.SystemMenuCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete System Menu", dataType = "SystemMenuDeleteCloudParam", dataTypeClass = SystemMenuDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(SystemMenuDeleteCloudParam param);






    // 查询主体菜单映射列表
    @ApiOperation(value = "Query Corp Menu Mapping List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.menu.SystemMenuCloudService.corpList")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemCorpMenuListCloudParam.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Menu List", dataType = "SystemCorpMenuListCloudDto", dataTypeClass = SystemCorpMenuListCloudDto.class),
    })
    @GetMapping("/corp")
    public abstract SystemCorpMenuListCloudDto corpList(SystemCorpMenuListCloudParam param);


    // 编辑主体菜单映射
    @ApiOperation(value = "Update Corp Menu Mapping", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.menu.SystemMenuCloudService.corpUpdate")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update System Menu", dataType = "SystemCorpMenuUpdateCloudParam", dataTypeClass = SystemCorpMenuUpdateCloudParam.class),
    })
    @PatchMapping("/corp/update")
    public abstract ResponseContent corpUpdate(@RequestBody SystemCorpMenuUpdateCloudParam param);

}
